package com.googlecode.jkorpos.hangul;
/**
 * This enumeration represents Korean Jongseong.
 */
public enum Jongseong implements Jaso {
	/** ㄱ */ KIYEOK(1), 
	/** ㄲ */ SSANG_KIYEOK(2), 
	/** ㄳ */ KIYEOK_SIOS(3),
	/** ㄴ */ NIEUN(4),
	/** ㄵ */ NIEUN_CIEUC(5),
	/** ㄶ */ NIEUN_HIEUH(6),
	/** ㄷ */ TIKEUT(7),
	/** ㄹ */ RIEUL(8), 
	/** ㄺ */ RIEUL_KIYEOK(9),
	/** ㄻ */ RIEUL_MIEUM(10), 
	/** ㄼ */ RIEUL_PIEUP(11), 
	/** ㄽ */ RIEUL_SIOS(12), 
	/** ㄾ */ RIEUL_THIEUTH(13), 
	/** ㄿ */ RIEUL_PHIEUPH(14), 
	/** ㅀ */ RIEUL_HIEUH(15),
	/** ㅁ */ MIEUM(16),
	/** ㅂ */ PIEUP(17),
	/** ㅄ */ PIEUP_SIOT(18), 
	/** ㅅ */ SIOS(19), 
	/** ㅆ */ SSANGSIOS(20),
	/** ㅇ */ IEUNG(21), 
	/** ㅈ */ CIEUC(22), 
	/** ㅊ */ CHIEUT(23), 
	/** ㅋ */ KHIEUKH(24), 
	/** ㅌ */ THIEUTH(25), 
	/** ㅍ */ PHIEUPH(26), 
	/** ㅎ */ HIEUH(27);
	
	public static final int START_INDEX = 0x11A7;
	
	private final int offset;
	
	Jongseong(int offset){
		this.offset = offset;
	}
	
	public int getOffset() {
		return offset;
	}

	public char toChar() {
		return (char)(START_INDEX + offset);
	}

	public static Jongseong valueOf(int i) {
		return Jongseong.values()[i - 1];
	}
}
